import request from '@/config/axios'
import type { RoomFloor } from './types'

export const getRoomFloorsListApi = (params: any): Promise<IResponse<IResData>> => {
  return request.get({ url: '/room-floors', params })
}

export const createRoomFloorsApi = (data: Partial<RoomFloor>): Promise<IResponse> => {
  return request.post({ url: '/room-floors', data })
}

export const bulkCreateRoomFloorsApi = (data: RoomFloor[]): Promise<IResponse> => {
  return request.post({ url: '/room-floors/bulk', data })
}

export const updateRoomFloorsApi = (id: string, data: Partial<RoomFloor>): Promise<IResponse> => {
  return request.put({ url: `/room-floors/id/${id}`, data })
}

export const getRoomFloorsDetailApi = (id: string): Promise<IResponse<RoomFloor>> => {
  return request.get({ url: `/room-floors/id/${id}` })
}

export const delRoomFloorsListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/room-floors/id/${ids[0]}` })
}
